<include file="Common/common" />

<body>
	<div class="layui-tab-item layui-show">
		<div class="layui-main">
			<br>
			<form class="layui-form"  action="" >

				<table class="layui-table" >
					<colgroup>
				      	<col width="150">
				      	<col width="150">
				    </colgroup>
				    <tr>
						<th>中心积分转交易手续费(%)</th>
						<th><input type="number" min="0" max="100" class="layui-input" name="cenToTra" lay-verify="number" value="{$Think.config.cenToTra}"/></th>
					</tr>
					<tr>
						<th>激活账号扣除中心积分</th>
						<th><input type="number" class="layui-input" name="activateScore" lay-verify="number" min="0" value="{$Think.config.activateScore}"/></th>
					</tr>
					<tr>
						<th>激活账号赠送任务积分</th>
						<th><input type="number" class="layui-input" name="registerScore" lay-verify="number" min="0" value="{$Think.config.registerScore}"/></th>
					</tr>
					<tr>
						<th>申请任务赠送投注积分</th>
						<th><input type="number" class="layui-input" name="giveScore" lay-verify="number" min="0" value="{$Think.config.giveScore}"/></th>
					</tr>
					<tr>
						<th>直推激活赠送动态秘钥</th>
						<th><input type="number" class="layui-input" name="giveDynamic" lay-verify="number" min="0" value="{$Think.config.giveDynamic}"/></th>
					</tr>
					<tr>
						<th>交易大厅小于N条开放交易积分购买</th>
						<th><input type="number" class="layui-input" name="lowest" lay-verify="number" min="0" value="{$Think.config.lowest}"/></th>
					</tr>
				</table>
				<table class="layui-table" >
					<colgroup>
				      	<col width="150">
				      	<col width="150">
				      	<col width="200">
				    </colgroup>	
				    <tr>
						<th>秘钥购买显示时间范围</th>
						<th><input type="text" id="lowestTime" name="lowestTime" lay-verify="required" autocomplete="off" class="layui-input" value="{$Think.config.lowestTime}"></th>
						<th><input type="text" id="biggestTime" name="biggestTime" lay-verify="required" autocomplete="off" class="layui-input" value="{$Think.config.biggestTime}" ></th>
					</tr>	
					<tr>
						<th>交易大厅开放时间</th>
						<th><input type="text" id="hallStart" name="hallStart" lay-verify="required" autocomplete="off" class="layui-input" value="{$Think.config.hallStart}"></th>
						<th><input type="text" id="hallEnd" name="hallEnd" lay-verify="required" autocomplete="off" class="layui-input" value="{$Think.config.hallEnd}" ></th>
					</tr>		    
				    <tr>
						<th>挂卖区间</th>
						<th><input type="number" min="0" name="sellMin" lay-verify="number" autocomplete="off" class="layui-input" value="{$Think.config.sellMin}"></th>
						<th><input type="number" min="0" name="sellMax" lay-verify="number" autocomplete="off" class="layui-input" value="{$Think.config.sellMax}" ></th>
					</tr>
				</table>
				<table class="layui-table" >
					<colgroup>
				      	<col width="150">
				      	<col width="150">
				      	<col width="200">
				    </colgroup>
					<thead>
						<tr>
							<th>直推级别</th>
							<th>直推人数</th>
							<th>赠送动态秘钥</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>2</td>
							<td><input type="number" min="0" class="layui-input" name="2_topNum" lay-verify="number" value="{$Think.config.2_topNum}"/></td>
							<td><input type="number" min="0" step="0.1" class="layui-input" name="2_dynamicNum" lay-verify="number" value="{$Think.config.2_dynamicNum}"/></td>
						</tr>
						<tr>
							<td>3</td>
							<td><input type="number" min="0" class="layui-input" name="3_topNum" lay-verify="number" value="{$Think.config.3_topNum}"/></td>
							<td><input type="number" min="0" step="0.1" class="layui-input" name="3_dynamicNum" lay-verify="number" value="{$Think.config.3_dynamicNum}"/></td>
						</tr>
					</tbody>
				</table>
				  
				<div class="layui-form-item">
					<div class="layui-input-block" style="margin-left: 105px;">
						<button class="layui-btn" lay-submit="" lay-filter="btn-saveVal">确定保存</button>
					</div>
				</div>
			</form> 

		</div>
	</div>
</body>
<script type="text/javascript">
	layui.use(['form','layer','jquery','laydate'], function () {
     
        // 操作对象
        var form = layui.form;
        var $ = layui.jquery;

        var laydate = layui.laydate;

        // 开启时间
        laydate.render({
	    	elem: '#lowestTime',
	    	type: 'time',
	    	format: 'HH:mm:ss'
	  	});
	  	// 关闭时间
	  	laydate.render({
	    	elem: '#biggestTime',
	    	type: 'time',
	    	format: 'HH:mm:ss'
	  	});

	  	// 交易大厅开放时间
	  	laydate.render({
	    	elem: '#hallStart',
	    	type: 'time',
	    	format: 'HH:mm:ss'
	  	});
	  	// 交易大厅关闭时间
	  	laydate.render({
	    	elem: '#hallEnd',
	    	type: 'time',
	    	format: 'HH:mm:ss'
	  	});

        form.on('submit(btn-saveVal)',function (data) {
            
            layer.confirm('确定保存？',{offset:'none'},function(index){
            	$.ajax({
	                type:'post',
	                url:"{:U('/admin.php/Index/ctrl_setval')}",
	                data:data.field,
	                dataType:'json',
	                success:function (rtJson) {
	                    layer.msg(rtJson.msg);
	                }
	            })
            });
            return false;
        })
    });
</script>
<include file="Common/footer" />